amelog ("Initing maps' interface ...")

if (type(server) == "nil") then
	server = { }
end

if (type(server.maps) == "nil") then
	server.maps = { }
end

map_register = function (map, map_id, map_name)
	amelog ("Initing LUA for map " .. map_name .. " (" .. map_id .. ")")
	server.maps[map_id] = { p=map, name=map_name, id=map_id, npcs={} }
	amelog("New id is : " .. server.maps[map_id].id )
	server.maps[map_id].mobs = {}
	return server.maps[map_id]
end

map_register_mob = function (map_id, name, x, y, z, id, class)
	amelog("Registring some mop")
	if type(server.maps[map_id].mobs[id]) == "table" then
		amelog("Warning: mob with this id alreadsy exists.")
		return 0
	end
	server.maps[map_id].mobs[id] = { hook=mapAddObject(map.p, x, y, 2, id, name), name=name, x=x, y=y, id=id, z=z,class=class }
	-- Add the npc to the map
	return 	server.maps[map_id].mobs[id]
end

amelog ("Finished initing interface...")